<%= stylesheet_link_tag 'pagination' %>

<% if logged_in? %>
<div style="float: right;">
  <%= link_to image_tag("/images/forum/new_post.gif"), new_post_path(:forum_id => @forum.id) %>
</div>
<% end %>
<br/>

<%= link_to "BeyondRails论坛", HOME + "/forums" %> » <%=h @forum.title %>

<table cellspacing="0" cellpadding="0" class="forum">
	<tr>
		<td>标题</td>
		<td>作者</td>
		<td class="number">回复/查看</td>
		<td>最后发表</td>
	</tr>
	<% @posts.each do |p| %>
	<tr>
		<td>
			<b><%= link_to p.title, post_path(p) %></b>
		</td>
		<td><%= p.user.login %></td>
		<td class="number"><%= p.comments_count.to_s + "/" + p.views_count.to_s %></td>
		<td>
			<%= p.created_at.strftime("%Y-%m-%d %I:%M %p") %>
			<br/>
			by <%= link_to p.last_user.login, "http://#{p.last_user.login}.beyondrails.com" %>
		</td>
  	</tr>
	<% end %>
</table>

<%= will_paginate @posts, :class => "flickr_pagination" %>